<%@ page language="java" pageEncoding="UTF-8" isErrorPage="true" contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%response.setStatus(HttpServletResponse.SC_OK);%>
<script type="text/javascript" src="../js/verify.js"></script>
<link href="<s:url value="../css/oa.css"/>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/pageJump.js"></script>
<script language='javascript'>
	function setValue(roleCode){
		document.form.action="../system/roleInfo!setUserRole.action?roleCode=" + roleCode;
		document.form.submit();
	}
</script>
<title>角色列表</title>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table">
	<tr>
		<td>
			<div align="center">
					<table cellspacing="0" cellpadding="0" border="0" width="100%">
						<tr>
							<td width="27">
								<img src="../images/dnavleft1.gif" width="27" height="28" />
							</td>
							<td background="../images/dnavbg1.gif" align="left" class="datetit">角色列表</td>
							<td width="55%" background="../images/dnavbg1.gif"  colspan="2" height="26" align="right" valign="top"/>
						</tr>
						<tr>
							<td class="dotline" colspan="4"></td>
						</tr>
					</table>
					<s:form action="roleInfo" id="form">
					<s:hidden name="operateFlag" id="operateFlag"/>
					<s:hidden name="userCodeTemp" id="userCodeTemp"/>
					<table width="100%" border="0" align="center" cellpadding="1" cellspacing="0" class="txt12" id="Table4">
						<tr>
							<td>
								<div id="Panel2">
									<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" class=table">
										<tr align="Center" class="td_title">
											<td height="18" align="center" class="fentitb">角色名</td>
											<td height="18" align="center" class="fentitb">角色代码</td>
										</tr>
										<s:iterator value="allRoleList" status="rowstatus">
											<tr>
												<td align="center" class="<s:if test="#rowstatus.odd == true">fencon_1</s:if><s:else>fencon_2</s:else>">
                                    				<a href="#" style="text-decoration: underline;" class="datetit" onclick="setValue(<s:property value="roleCode"/>)">
														<s:label theme="simple" value="%{roleName}"/>
													</a>
												</td>
                                    			<td align="center" class="<s:if test="#rowstatus.odd == true">fencon_1</s:if><s:else>fencon_2</s:else>">
                                    				<s:label theme="simple" value="%{roleCode}"/></td>
											</tr>
										</s:iterator>
									</table>
								</div>
							</td>
						</tr>
					</table>
				</s:form>	
			</div>
		</td>
	</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table">
	<tr>
		<td>
			<div align="center">
				<s:form action="roleInfo!allRoleListPage">
					<s:hidden name="userInfoVO.userCode" id="userCode"/>
					<s:hidden name="userInfoVO.pageNum" id="pageNum"/>
					<s:hidden name="userInfoVO.pageIndex" id="pageIndex"/>
					<s:hidden name="userInfoVO.pageRowNum" id="pageRowNum"/>
					<tr>
						<td align="left" colspan="2">
							<s:submit theme="simple" key="上一页" cssClass="button7" disabled="%{!userInfoVO.pageHasBefor}" onclick="return pageJump('%{userInfoVO.pageIndex}','%{userInfoVO.pageNum}',1)"></s:submit>
							<s:submit theme="simple" key="下一页" cssClass="button7" disabled="%{!userInfoVO.pageHasNext}" onclick="return pageJump('%{userInfoVO.pageIndex}','%{userInfoVO.pageNum}',2)"></s:submit>
						</td>
						<td align="left" colspan="2">	
							当前第<s:property value="userInfoVO.pageIndex"/>页
							共<s:property value="userInfoVO.pageNum"/>页
						</td>
						<td align="left" colspan="2">
							到<s:textfield theme="simple" name="goPage" id="goPage" />页
							<s:submit theme="simple" key="GO" cssClass="button7"  onclick="return pageJump('%{userInfoVO.pageIndex}',document.getElementById('pageNum').value,3)"></s:submit>
						</td>
					</tr>
				</s:form>
			</div>
		</td>
	</tr>
</table>
<script type="text/javascript" defer="defer">
	var operateFlag = document.getElementById("operateFlag").value;
	if(operateFlag == 'OK'){
		alert("分配角色成功！");
		window.opener.location.href='../system/roleInfo.action';
		window.close();
	}
</script>
